package com.huazi.user.registration.tool;

import java.util.List;

public class Page<T> {
    //查询总记录数
    private Integer totalcount;
    //每页显示条数
    private Integer pageSize;
    //总分页数
    private Integer totalpage;
    //当前页码
    private Integer currterPage;

    public Integer getTotalcount() {
        return totalcount;
    }

    public void setTotalcount(Integer totalcount) {
        this.totalcount = totalcount;
        this.totalpage = totalcount % pageSize == 0 ? totalcount / pageSize : totalcount / pageSize + 1;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getTotalpage() {
        return totalpage;
    }

    public void setTotalpage(Integer totalpage) {


    }

    @Override
    public String toString() {
        return "Page{" +
                "totalcount=" + totalcount +
                ", pageSize=" + pageSize +
                ", totalpage=" + totalpage +
                ", currterPage=" + currterPage +
                ", list=" + list +
                '}';
    }

    public Integer getCurrterPage() {
        return currterPage;
    }

    public void setCurrterPage(Integer currterPage) {
        this.currterPage = currterPage;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    //查询出来的结果集
    private List<T> list;
}
